﻿using Sowrk03_28.Repository.Impls;
using Sowrk03_28.Repository.Interface;
using Swork03_28.Domain.TraceableInfos;
using Swork03_28.Services.Interface;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;

namespace Swork03_28.Services.Impls
{
    public class FarmedService : IFarmedService
    {
        private readonly IFarmedRepository farmedRepository;

        public FarmedService(IFarmedRepository farmedRepository)
        {
            this.farmedRepository = farmedRepository;
        }

        public async Task<List<Farmed>> AllAsync()
        {
            return await farmedRepository.AllAsync();
        }

        public async Task<int> CreateAsync(Farmed entity)
        {
            return await farmedRepository.CreateAsync(entity);
        }

        public async Task<int> DeleteAllAsync(List<Farmed> t)
        {
            return await farmedRepository.DeleteAllAsync(t);
        }

        public async Task<int> DeleteAsync(Farmed entity)
        {
            return await farmedRepository.DeleteAsync(entity);
        }

        public async Task<Farmed> GetAsync(int id)
        {
            return await farmedRepository.GetAsync(id);
        }

        public async Task<List<Farmed>> GetValues(Expression<Func<Farmed, bool>> expre)
        {
            return await farmedRepository.GetValues(expre);
        }

        public async Task<int> UpdateAsync(Farmed entity)
        {
            return await farmedRepository.UpdateAsync(entity);
        }
    }
}
